1. Field of the Invention
The present invention relates generally to digital data storage system operation. More specifically, the present invention relates to a method and an apparatus for distributing commands to a digital data storage system.
2. Description of the Related Art
The operating system (OS) of a computer controls the delivery of read commands to a storage medium (e.g., disk drive). For example, in the case of a redundant array of independent disks (RAID) mirroring implementation, where multiple disk drives are employed, the OS will send the read commands to the queue of a primary drive until that drive is full. When the queue of the primary drive is full, the read commands are held until the queue for the primary drive is decreased. Therefore, the OS is forced to wait until the primary drive processes read commands to free up capacity in the queue.
FIG. 1 shows a block diagram 100 depicting how read commands are handled for a software RAID implementation, in accordance with the prior art. An application 102 requires data and notifies the operating system (OS) 104. The operating system 104 issues a read command to a RAID driver 106. In the case of RAID level 1 (mirroring), both read and write commands are sent to a primary drive D1 108 from the RAID driver 106. A secondary drive D2 110 is used to process write commands, but is not utilized to process read commands. As more read commands are issued from the operating system 104, the read commands are queued to be processed by the primary drive D1 108. For example, the primary drive D1 108 has a random access memory (RAM) in which tagged command queuing is performed. The read commands continue to accumulate until the queue for primary drive D1 108 reaches a full level. While the primary drive D1 108 can theoretically queue up to 256 commands, typically the primary drive D1 108 issues a queue full message to stop sending additional read commands after 16, 32, or 64 commands have been queued. When the primary drive D1 108 issues a queue full message, the read commands are held until the primary drive D1 108 sends a response that a read command has been processed. Since a disk drive is much slower than a central processing unit (CPU), because of the physical limitations of the mechanical activity of the disk drive, the disk drive becomes the main bottleneck. Therefore, as the OS 104 continues to issue more commands, the primary drive D1 108 is unable to provide the desired throughput.
FIG. 2 shows a block diagram 112 depicting how read commands are handled for a hardware RAID implementation, in accordance with the prior art. FIG. 2 is substantially similar to FIG. 1 except that a RAID controller 114 replaces the RAID driver 106. The RAID controller 114 includes firmware FW 116 which directs the read commands to the primary drive D1 108. Again, the read commands are queued in the RAM of the primary drive D1 108. Accordingly, the same bottleneck exists. Furthermore, it should be appreciated that while write commands are issued to primary drive D1 108 and secondary drive D2 110, especially in the case of RAID level 1 (mirroring), the read commands are only issued to the primary drive D1 108.
Under the configurations of FIGS. 1 and 2, the primary drive D1 108 is exercised much more than the secondary drive D2 110. Therefore, excessive use of the primary drive D1 108 contributes to a higher probability of failure for the primary drive D1 108 than for the secondary drive D2 110. Consequently, a shorter mean time between failures (MTBF) is encountered for the primary drive D1 108. Also, consecutive read commands processed by the primary drive D1 108 may reference addresses that are physically remote with respect to each other. In these instances, the relatively large movement required of a read head results in an increased latency in performing the read command. Consequently, the increased latency causes a reduction in overall read command processing performance.
In view of the foregoing, there is a need to solve the problems of the prior art by determining a way to balance read commands more evenly between multiple disk drives. Also, the solution to the problems of the prior art should enhance the performance and reliability of the disk drives.